package com.igeek.oop.pojo;

import com.igeek.oop.dao.Info;

import java.util.Scanner;

public class Admin extends Person{

    /**
     * 录入用户信息
     */
    public void insertInfo(Computer computer){

        Scanner scanner = new Scanner(System.in);

        System.out.println("请输入用户名：");
        String username = scanner.next();

        System.out.println("请输入密码：");
        String password = scanner.next();

        System.out.println("请输入指纹：");
        String fingerprint = scanner.next();

        Info info = new Info();

        computer.insertInfo(info);
    }

    /**
     * 开门
     */
    public void openDoor(ElectronicDoor door){

        //1.判断门铃状态：
        if(!door.isOn() && door.isDoorbell()){

            //把电子门打开
            door.setOn(true);

            System.out.println("管理员已开门");
        }else{
            System.out.println("其他情况，无法开门");
        }
    }
}
